package com.github.cakin.shiro.chapter10.web.listener;

import org.apache.shiro.session.Session;
import org.apache.shiro.session.SessionListener;
import org.apache.shiro.session.mgt.eis.AbstractSessionDAO;
import org.apache.shiro.session.mgt.eis.CachingSessionDAO;
import org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO;
import org.apache.shiro.session.mgt.eis.SessionDAO;

/**
 * @className: MySessionListener1
 * @description: 定义Session监听器
 * @date: 2020/5/22
 * @author: cakin
 */
public class MySessionListener1 implements SessionListener {

    public void onStart(Session session) { // 会话创建时触发
        System.out.println("会话创建：" + session.getId());
    }
    public void onExpiration(Session session) { // 会话过期时触发
        System.out.println("会话过期：" + session.getId());
    }
    public void onStop(Session session) { // 退出/会话过期时触发
        System.out.println("会话停止：" + session.getId());
    }

}
